package com.example.guessgame;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class CharsAdapter extends BaseAdapter {

	@SuppressWarnings("unused")
	private static final String	TAG			= "CharsAdapter";
	String[]					mChars		= null;
	MainActivity				mContext	= null;
	String						mAnswerStr	= null;

	public CharsAdapter(MainActivity context, String[] mChars, String answerStr) {
		this.mContext = context;
		this.mChars = mChars;
		this.mAnswerStr = answerStr;
	}

	@Override
	public int getCount() {
		return mChars.length;
	}

	@Override
	public Object getItem(int position) {
		return mChars[position];
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = LayoutInflater.from(mContext).inflate(R.layout.item,
					null);
		}
		((TextView) convertView).setText((String) getItem(position));
		((TextView) convertView).setTag(getItem(position));
		return convertView;
	}

}
